﻿
@{
    ViewBag.Title = "EmployeePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link rel="stylesheet" href="~/assets/portal/assets/css/common.css" />
    <link rel="stylesheet" href="~/bussiness/js/base/reset.css" />
    <link rel="stylesheet" href="~/bussiness/js/pg/Performance/edit.css" />
    <style>

        #editor—wrapper {
            /*max-width: 90%;*/
            width: 1200px !important;
            border: 1px solid #ccc;
            z-index: 100; /*  按需定义 */
        }

        .title {
            font-weight: bolder;
        }

        #toolbar-container {
            border-bottom: 1px solid #ccc;
        }

        #editor-container {
            min-height: 310px;
            margin-bottom: 200px;
        }

            #editor-container .title::before {
                content: ""
            }

        .ant-select-arrow, .ant-select-clear {
            position: absolute;
            right: 10px;
        }

        .stitle {
            font-size: 16px;
            font-weight: 600;
            color: #424758;
            display: flex;
            align-items: center;
        }

            .stitle::before {
                content: "";
                margin-right: 10px;
                display: inline-block;
                width: 4px;
                height: 18px;
                background: #0064E5;
            }

        .stable {
            border-collapse: collapse; /* 折叠边框，使之变为单一线划分 */
            border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
            width: 100%;
            max-height: 800px;
            overflow: scroll;
        }

            .stable th {
                background: #f2f6f9;
                font-size: 14px;
                font-weight: 600;
            }

            .stable th, .stable td {
                border: 1px solid #e1e5ea; /* 设置表格、表头、单元格边框 */
                text-align: center;
                height: 48px;
            }
    </style>
}
<div id="AccidentManagementAdd" class="font-['SourceHanSansSC']">
    <a-style-provider hash-priority="high">
        <a-config-provider :locale="vlocale">
            <header class="px-5 box-border">
                <div class="flex items-center">
                    <div class="w-full h-[48px] text-[13px]  rounded-lg mx-auto mt-[20px]  bg-white  text-[#888888] text-3xl flex items-center px-10">   <div class="w-22 h-22 bg-blue-200 mr-5"> <img class="w-full h-full cursor-pointer" v-on:click="AccidentManagementAddParams.vvback()" src="~/Assets/nimgs/exit.png" alt="返回" /></div> <span class="text-[#424758] text-[15px]">{{AccidentManagementAddParams.urlinfo.value.type?{1:'事故编辑',9:'事故详情'}[AccidentManagementAddParams.urlinfo.value.type]:'新增事故'}}  </span> </div>
                </div>
            
                <a-modal v-model:open="AccidentManagementAddParams.textareaShow.value" width="60%" title="事故经过" v-on:ok="AccidentManagementAddParams.handleOk">
                    <div style="padding:30px;box-sizing:border-box">
                        <a-textarea v-model:value="AccidentManagementAddParams.textareaContent.value"
                                    allow-clear
                                    :disabled="AccidentManagementAddParams.urlinfo.value.type==9"
                                    placeholder="请输入事故经过"
                                    :auto-size="{ minRows: 20 }" />
                    </div>
                </a-modal>
                <m-image-model></m-image-model>
                <m-pdf-pop-model></m-pdf-pop-model>
       
                <a-card :bordered="true" class="w-full  mt-0">
                    <template #title>
                        <div class="w-full flex justify-between items-center;">
                            <div class="flex items-center"> <div>事故管理</div> <div class="ml-7"></div></div>
                        </div>
                    </template>
                    <a-spin :spinning="AccidentManagementAddParams.uploadLock.value" tip="加载中，请耐心等待..." />
                    <div class="stitle" style="margin:10px 0">基本信息</div>
                    <div id="tableContainer"></div>
                    <a-form style="margin-top:10px"
                            ref="FormRule"
                            layout="inline"
                            :model="AccidentManagementAddParams.formData.value">

                        <a-form-item label="发布人：">
                            <a-input disabled v-model:value="AccidentManagementAddParams.formData.value.user" style="width:200px" />
                        </a-form-item>
                        <a-form-item label="发布日期：">
                            <a-input disabled v-model:value="AccidentManagementAddParams.formData.value.time" style="width: 200px" />
                        </a-form-item>
                        <a-form-item label="年份：">
                            <a-select allow-clear
                                      show-search
                                      style="width: 200px"
                                      :disabled="AccidentManagementAddParams.urlinfo.value.type==9"
                                      placeholder="请先选择年份"
                                      v-model:value="AccidentManagementAddParams.formData.value.Years"
                                      :options="AccidentManagementAddParams.yearList.value"></a-select>
                        </a-form-item>

                        <a-form-item>

                    </a-form>
                    <div class="stitle" style="margin:20px 0">事故信息</div>
                    <a-card :bordered="true" class="w-full  mt-12">
                        <template #title>
                            <div class="w-full flex justify-between items-center;">
                                <div class="flex items-center"> <div>事故信息列表</div> <div class="ml-7"></div></div>
                            </div>
                        </template>
                        <table class="stable">
                            <tr>
                                <th>序号</th>
                                <th>名称</th>
                                <th>类型</th>
                                <th>发生时间</th>
                                <th>事故经过</th>
                                <th>责任部门</th>
                                <th>责任人</th>
                                <th>关闭时间</th>
                                @*<th>备注</th>*@
                                <th>附件</th>

                                <th v-if="AccidentManagementAddParams.urlinfo.value.type!=9"><a-button v-on:click="AccidentManagementAddParams.addConfig" size="small" type="primary">新增</a-button></th>
                            </tr>
                            <tr v-for="(e,i) in AccidentManagementAddParams.settingList.value" :key="i">
                                <td>
                                    {{i+1}}
                                </td>
                                <td>
                                    <a-input style="width: 96%" :disabled="AccidentManagementAddParams.urlinfo.value.type==9" v-model:value="e.Name">
                                    </a-input>
                                </td>
                                <td>
                                    <a-select allow-clear
                                              show-search
                                              style="width: 96%"
                                              :filter-option="AccidentManagementAddParams.filterOption"
                                              placeholder="请选择类型"
                                              :disabled="AccidentManagementAddParams.urlinfo.value.type==9"
                                              v-model:value="e.TypeId"
                                              :options="AccidentManagementAddParams.typeList.value"></a-select>
                                </td>
                                <td>
                                    <a-date-picker show-time format="YYYY-MM-DD HH:mm" :disabled="AccidentManagementAddParams.urlinfo.value.type==9" v-model:value="e.AccidentDate" />
                                </td>
                                <td>
                                    <a-input style="width: 96%" readonly v-on:click="AccidentManagementAddParams.handleoptextarea(i)" v-model:value="e.Description">
                                    </a-input>
                                </td>
                                <td>
                                    <a-select allow-clear
                                              show-search
                                              style="width: 96%"
                                              :disabled="AccidentManagementAddParams.urlinfo.value.type==9||AccidentManagementAddParams.userinfo.value.DepartmentId!=20"
                                              :filter-option="AccidentManagementAddParams.filterOption"
                                              placeholder="责任部门"
                                              v-model:value="e.DepartmentId"
                                              :options="AccidentManagementAddParams.deptList.value"></a-select>
                                </td>
                                <td>
                                    <a-input style="width: 96%" :disabled="AccidentManagementAddParams.urlinfo.value.type==9" v-model:value="e.Responsible">
                                    </a-input>
                                </td>
                                <td>
                                    <a-date-picker :disabled="AccidentManagementAddParams.urlinfo.value.type==9" show-time format="YYYY-MM-DD HH:mm" v-model:value="e.CloseTime" />
                                </td>
                                @*<td>
                                    <a-input style="width: 96%" :disabled="AccidentManagementAddParams.urlinfo.value.type==9" v-model:value="e.Remark">
                                    </a-input>
                                </td>*@
                                <th style="width:50px">

                                    <a-upload v-model:file-list="AccidentManagementAddParams.uploadImg.value.fileList"
                                              action="#"
                                              multiple
                                              :show-upload-list="false"
                                              v-on:change="AccidentManagementAddParams.handleChange($event,i)">
                                        <a-button v-if="AccidentManagementAddParams.urlinfo.value.type!=9" type="link">上传</a-button>
                                    </a-upload>


                                    <a-tooltip placement="left" color="#fff">
                                        <template #title>
                                            <div v-for="es in e.FileList" style=" color:#000;display:flex;align-items:center;"><span style="margin-right: 10px; max-width: 110px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{es.FileName}}</span> <a-space> <span v-if="['jpg','jpeg','png','gif','bmp','tiff','svg','pdf'].includes(es.FileExtension.split('.')[1])" v-on:click="AccidentManagementAddParams.handlePreview(es)" style="cursor: pointer; color: #60a1fd">预览</span><span v-on:click="AccidentManagementAddParams.downLoad(es.FileName,es.FilePath)" style="cursor: pointer; color: #60a1fd">下载</span><span v-on:click="AccidentManagementAddParams.deletefile(es)" v-if="AccidentManagementAddParams.urlinfo.value.type!=9" style="cursor: pointer; color: #e75448">删除</span>     </a-space>            </div>
                                        </template>
                                        <a-button type="link">详情</a-button>
                                    </a-tooltip>


                                </th>

                                <td v-if="AccidentManagementAddParams.urlinfo.value.type!=9">
                                    <a-space  direction="vertical">
    
                                            <a-button v-on:click="AccidentManagementAddParams.ISaveAccidentItem(e)" size="small" type="primary">保存</a-button>
                                            <a-button v-on:click="AccidentManagementAddParams.IdelConfig(i,e)" size="small" style="margin-top:4px" type="primary" danger>删除</a-button>
                     
                                        </a-space>
                                   

                                </td>
                            </tr>
                        </table>

                    </a-card>
                    <a-form-item label-align="right" style="margin-top:20px" label="备注：">
                        <a-textarea style="width:600px" :disabled="AccidentManagementAddParams.urlinfo.value.type==9||AccidentManagementAddParams.userinfo.value.DepartmentId!=20" v-model:value="AccidentManagementAddParams.formData.value.Remark">
                        </a-textarea>
                    </a-form-item>
                </a-card>

            </header>

            <m-bottom-btns></m-bottom-btns>
        </a-config-provider>
    </a-style-provider>
</div>
@section Js{
    <script src="~/bussiness/js/base/tailwind.js"></script>
    <script>
    </script>
    <script type="module">
        import Composition from '../../bussiness/js/pg/AccidentManagement/AMAdd.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")'
        import localeValues from '../../Bussiness/js/base/es/locale/zh_CN.js'
        singalApp('AccidentManagementAdd', Composition, localeValues)
    </script>
}
